/*
 * Copyright (c) 2006-2020, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-02-21     tinnu       the first version
 */
#ifndef APPLICATIONS_MIDDLEWARE_TARM_UART_H_
#define APPLICATIONS_MIDDLEWARE_TARM_UART_H_

#include "at32f4xx.h"

#define _UARTSAVEBUFSIZE 100
struct _StructUartBuf
{
    int RxbufSize;
    short FinishFlag;
    char Rxbuf[_UARTSAVEBUFSIZE];
};
extern struct _StructUartBuf StructUart0RxBuf,StructUart1RxBuf;

#define PRINT_MAIN(n) PRINTF_UART1(n)

void PRINTF_UART0(const char *data);
void PRINTF_UART1(const char *data);

void PRINTF_UART0OnSize(const char *data, uint16_t length);
void PRINTF_UART1OnSize(const char *data, uint16_t length);

void Uart1DMA_Configuration(void);
void Uart2DMA_Configuration(void);

#endif /* APPLICATIONS_MIDDLEWARE_TARM_UART_H_ */
